import request from '@/utils/request'

export function getSysRole(data) {
  return request({
    url: '/role/page',
    method: 'post',
    data
  })
}

export function getSysRoleDetail(data) {
  return request({
    url: 'role/' + data,
    method: 'get'
  })
}

export function addSysRole(data) {
  return request({
    url: 'role/add',
    method: 'post',
    data
  })
}
export function editSysRole(data) {
  return request({
    url: 'role/update',
    method: 'post',
    data
  })
}

export function deleteSysRole(data) {
  return request({
    url: '/role/delete/' + data,
    method: 'post'
  })
}

export function getSysRoleMenu(data) {
  return request({
    url: '/role/menu/byRoleId/' + data,
    method: 'post'
  })
}

export function editSysRoleMenu(data) {
  return request({
    url: 'role/menu/update',
    method: 'post',
    data
  })
}
